package com.sxkiler.demo.test;

public class Idcheck {

    public static void main(String args[]){
        String id = "4405";
        String end = "";
        String checkcode = "0";

        for(int i=0;i<10;i++){
            for(int j=0;j<10;j++){
                String ids = id+i+j+end;
                if(checkid(ids,checkcode)){
                    System.out.println(ids+checkcode);
//                    break;
                }
            }

        }
    }
    public static boolean checkid(String id,String checkcode){
        Integer [] xishu = new Integer[]{7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2};
        String [] s = id.split(".");
        int total = 0;
        for(int i=0;i<s.length;i++){
            total += (Integer.parseInt(s.toString())*xishu[i]);
        }
        if(checkcode.equals(String.valueOf(total%11))){
            return true;
        }
        return false;
    }
}
